#!/usr/bin/perl

use strict;
use warnings;
use Data::Dumper;

my $output = '';
my $counter = 0;
my $log_file = $ARGV[0];

while(<STDIN>){
	if($_ =~ m/\S/){
		$output = $output . $_;
		$counter = $counter + 1;
	}
	else {
		$counter = 0;
		$output = '';
	}
	if($counter >= 9 ){
		open FH, ">$log_file" or die "I can't open that!";
		print FH $output;
		close FH;
	}

}
